<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <script src="./promise2-then.js"></script> -->
    <script>
        let p = new Promise((resolve, reject) => {
            // resolve(2)
            reject(3);
            // setTimeout(() => {
            //     // resolve(111);
            //     reject('222')
            // }, 3000)
        });

        p.then (
            
        )
        .catch ((reason) => {
            console.log('错误的----' + reason);
        }) 
        .then (value => {
            console.log("onResolved2----" + value);
        }, reason => {
            console.log("onRejected2----" + reason);
        }).finally(() => {
            console.log('finally-------');
        }).then(
            value => {console.log("value----", value);},
        )




        // p.then (value => {
        //     console.log("onResolved2----" + value);
        // }, reason => {
        //     console.log("onRejected2----" + reason);
        // })
        console.log(p);
    </script>
</body>
</html>